// pages/index/class/sourceList/sourceList.js
const util = require("../../../../utils/util.js");
const config = require("../../../../utils/config.js");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    courseList: [],
    classId: '',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    util.setBarColor()
    this.setData({
      classId: options.classId
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    this.getData()
  },

  getData: function () {
    var that = this;
    let url = config.BaseUrl + "t/course/class/teacher/queryCourseMessage";
    let data = {
      "classId": that.data.classId
    };
    util.request(url, data, "GET").then(function (res) {
      if (res.code == 200) {
        that.setData({
          courseList: res.data
        })
      }
    })
  },
})